import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class Mina here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Mina extends Objeto
{
    /**
     * Act - do whatever the Mina wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    private GreenfootImage image;
    private boolean existe;
    public Mina()
    {
        existe=true;
        image=new GreenfootImage("mina.png");
        image.scale(35,35);
        setImage(image);
    }
   
    
    public void act() 
    {
         checkImpact();
         if(existe==false)
         {
             getWorld().removeObject(this);
         }
        // Add your action code here.
    }  
    
      public void checkImpact()
    {
    if (getOneIntersectingObject(Hero.class) != null)
        {
            
           existe =false;
           getWorld().addObject(new Explosion(),getX(),getY()-40);
           ((FlagWarWorld)getWorld()).setJugador(true);
           
            
        }
   }
}
